home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6659 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  991 b 

  1. Path: hermes.oc.com!usenet
  2. From: Larry Weiss <lfw@oc.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: MACROS with varying number of parameters
  5. Date: Thu, 15 Feb 1996 16:05:14 -0600
  6. Organization: OpenConnect Systems, Dallas, TX, USA
  7. Message-ID: <3123AE1A.5133@oc.com>
  8. References: <freedmanj-1502961337370001@155.95.68.41>
  9. NNTP-Posting-Host: ocs2228.oc.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14. CC: lfw@oc.com
  15.  
  16. Jerry Freedman wrote:
  17.  > 
  18.  >    A while back I saw a trick for writing macros with a variable number of
  19.  > paramters. Its very useful for debugging stuff like
  20.  > 
  21.  > #ifdef
  22.  > #define DEBUG_PRINT(some parameters) printf(parameters)
  23.  > #else
  24.  > #define DEBUG_PRINT(some_parameters)
  25.  > #endif
  26.  > 
  27.  >    Unfortunately, I lost it. I'd like to see it again,
  28.  > 
  29.  
  30. Why not just pass the entire printf() expression to the macro
  31. and let it use it.   Have you coded a complete example of what you'd
  32. like to do?
  33.